/* Page-specific styles for chat pages */
body {
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  height: 100vh;
}

/* Chat header styles for login */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-button {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.share-button:hover {
  background-color: var(--bg-hover);
  border-color: var(--primary-color);
}

.system-message {
  background-color: #f0f7ff;
  border-left: 4px solid #2196F3;
  padding: 12px;
  margin: 10px 0;
  font-style: italic;
  color: #1565C0;
}

.login-button, .logout-button {
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.login-button:hover, .logout-button:hover {
  background-color: var(--bg-hover);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name {
  font-size: 14px;
  color: var(--text-secondary);
}

.provider-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 4px;
}

.provider-icon.google {
  background-image: url('');
}

.provider-icon.facebook {
  background-image: url('');
}

.provider-icon.microsoft {
  background-image: url('');
}

.provider-icon.github {
  background-image: url('');
}


/* OAuth Popup Styles */
.oauth-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.oauth-popup {
  background-color: var(--bg-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 400px;
  overflow: hidden;
}

.oauth-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.oauth-popup-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.oauth-popup-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition);
}

.oauth-popup-close:hover {
  background-color: var(--bg-hover);
}

.oauth-popup-content {
  padding: 20px;
}

.oauth-popup-content p {
  margin: 0 0 20px 0;
  color: var(--text-secondary);
  text-align: center;
}

.oauth-providers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.oauth-provider-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.oauth-provider-button:hover {
  background-color: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.oauth-icon {
  width: 20px;
  height: 20px;
}

.oauth-provider-button.google:hover {
  border-color: #4285F4;
}

.oauth-provider-button.facebook:hover {
  border-color: #1877F2;
}

.oauth-provider-button.microsoft:hover {
  border-color: #F25022;
}

.oauth-provider-button.github:hover {
  border-color: #333;
}

/* Email Login Section */
.oauth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
}

.oauth-divider span {
  flex: 1;
  color: var(--text-secondary);
  font-size: 14px;
}

.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.oauth-divider::before {
  margin-right: 15px;
}

.oauth-divider::after {
  margin-left: 15px;
}

.email-login-section {
  margin-top: 20px;
}

.email-login-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--text-primary);
}

.email-login-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 12px;
  transition: var(--transition);
}

.email-login-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(94, 94, 255, 0.1);
}

.email-login-button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background-color: var(--primary-color);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.email-login-button:hover {
  background-color: #4a4aff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.email-login-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.email-login-note {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 12px;
}

/* Site selector dropdown */
.site-dropdown {
  position: absolute;
  left: 0;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 10;
}

/* Position below in centered input, above in regular input */
.centered-input-container .site-dropdown {
  top: 100%;
  margin-top: 8px;
}

.chat-input-container .site-dropdown {
  bottom: 100%;
  margin-bottom: 8px;
}

.site-dropdown.show {
  display: block;
}

.site-dropdown-item {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.site-dropdown-item:hover {
  background-color: var(--hover-bg);
}

.site-dropdown-item.selected {
  background-color: var(--primary-color);
  color: white;
}

.site-dropdown-header {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 12px;
  font-weight: 600;
}

/* Mode selector - positioned at bottom */
.input-site-selector {
  position: relative;
  margin-right: 8px;
}

.site-selector-icon {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background-color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.site-selector-icon:hover {
  background-color: var(--hover-bg);
}

.site-selector-icon svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.input-mode-selector {
  position: relative;
  margin-right: 8px;
}

.mode-selector-icon {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background-color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.mode-selector-icon:hover {
  background-color: var(--hover-bg);
}

.mode-selector-icon svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.mode-dropdown {
  position: absolute;
  left: 0;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  min-width: 150px;
  display: none;
  z-index: 10;
}

/* Position below in centered input, above in regular input */
.centered-input-container .mode-dropdown {
  top: 100%;
  margin-top: 8px;
}

.chat-input-container .mode-dropdown {
  bottom: 100%;
  margin-bottom: 8px;
}

.mode-dropdown.show {
  display: block;
}

.mode-dropdown-header {
  padding: 8px 12px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}

.mode-dropdown-item {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.mode-dropdown-item:hover {
  background-color: var(--hover-bg);
}

.mode-dropdown-item.selected {
  background-color: var(--primary-color);
  color: white;
}

/* Messages container with max-width */
.messages-container {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding: 24px;
}

.message {
  display: flex;
  gap: 16px;
}

.message-content {
  padding-top: 4px;
}

/* Input Area */
.chat-input-container {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  padding: 16px 0;
}

.chat-input-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.chat-input-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.chat-input-box:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(94, 94, 255, 0.1);
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  outline: none;
  max-height: 200px;
  overflow-y: auto;
  font-family: inherit;
}

.chat-input::placeholder {
  color: #999;
}

.send-button {
  background-color: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.send-button:hover {
  background-color: var(--hover-bg);
  color: var(--text-primary);
}

.send-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.send-button svg {
  width: 18px;
  height: 18px;
}

/* Search Results Styling */
.search-results {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.search-result-item {
  margin-bottom: 16px;
  padding: 12px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  transition: var(--transition);
}

.search-result-item:hover {
  background-color: var(--hover-bg);
}

.result-title {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  display: block;
  margin-bottom: 4px;
}

.result-title:hover {
  text-decoration: underline;
}

.result-description {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.4;
}

/* Centered Input Styles */
.centered-input-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 24px;
}

/* Input box row styles for centered input */
.input-box-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-box-bottom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.centered-input-wrapper {
  width: 100%;
  max-width: 800px;
}

.site-selector-wrapper {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-selector-wrapper label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.site-select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.site-select:hover {
  border-color: var(--primary-color);
}

.site-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(94, 94, 255, 0.1);
}

.centered-input-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.centered-input-box:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(94, 94, 255, 0.1), var(--shadow-md);
}

.centered-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1.6;
  resize: none;
  outline: none;
  min-height: 60px;
  max-height: 200px;
  overflow-y: auto;
  font-family: inherit;
  padding: 4px 0;
}

.centered-chat-input::placeholder {
  color: #999;
}

.centered-send-button {
  background-color: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.centered-send-button:hover {
  background-color: var(--hover-bg);
  color: var(--text-primary);
}

.centered-send-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.centered-send-button svg {
  width: 18px;
  height: 18px;
}

/* Message sender name styling */
.message-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  opacity: 0.8;
}

.user-message .message-sender {
  color: var(--primary-color);
}

.assistant-message .message-sender {
  color: var(--accent-color, #6B46C1);
}

/* Connection Mode Toggle */
.connection-toggle {
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.connection-toggle:hover {
  opacity: 1;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 20px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 20px;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .toggle-slider {
  background-color: #6c757d;
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-label-left,
.toggle-label-right {
  font-size: 8px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  z-index: 1;
  pointer-events: none;
}

.toggle-label-left {
  opacity: 0.9;
  transition: opacity 0.3s;
}

.toggle-label-right {
  opacity: 0.6;
  transition: opacity 0.3s;
}

input:checked + .toggle-slider .toggle-label-left {
  opacity: 0.6;
}

input:checked + .toggle-slider .toggle-label-right {
  opacity: 0.9;
}

/* Sample Queries Styles */
.sample-queries-container {
  margin-top: 30px;
  width: 100%;
  max-width: 800px;
}

.sample-queries-list {
  padding: 15px;
}

.sample-query-item {
  padding: 4px 0;
  color: #999;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s;
  line-height: 1.4;
}

.sample-query-item:hover {
  opacity: 0.7;
  text-decoration: underline;
}

.sample-query-item span:first-child {
  font-weight: 400;
}

/* Responsive overrides */
@media (max-width: 768px) {
  .messages-container,
  .chat-input-wrapper {
    padding: 16px;
  }

  .connection-toggle {
    order: -1;
  }
}